from tortoise.models import Model
from tortoise import fields


class SystemLog(Model):
    id = fields.IntField(pk=True)
    user_name = fields.ForeignKeyField("models.User", related_name="system_logs")
    request_time = fields.DatetimeField(auto_now_add=True, description="登录时间")
    router = fields.CharField(max_length=64, description="路由地址")
    request_ip = fields.CharField(max_length=64, description="IP地址")
    request_status = fields.CharField(max_length=16, description="登录状态")  # 如：成功、失败
